package com.itheima.admin.controller;

import com.itheima.admin.pojo.ClassTable;
import com.itheima.admin.service.ClassTableService;
import com.itheima.admin.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/classTable")
public class ClassTableController {
    @Autowired
    private ClassTableService classTableService;
    @GetMapping("/getAllClass")
    public Result getAllClassTable(){
        return classTableService.selectAllClass();
    }

    @PutMapping("/insertClass")
    public Result insertClass(@RequestBody  ClassTable classTable){

        return classTableService.insertClass(classTable);
    }

    @DeleteMapping("/deleteClass")
    public Result deleteClass(@RequestBody ClassTable classTable){
        return classTableService.deleteClass(classTable);
    }
}
